home *** CD-ROM | disk | FTP | other *** search
- Path: ecmwf.int!munin!mab
- From: mab@ecmwf.co.uk (Baudouin Raoult)
- Newsgroups: comp.lang.c++
- Subject: Re: locking
- Date: 11 Jan 1996 00:12:18 GMT
- Organization: European Centre for Medium Range Weather Forecasts
- Distribution: world
- Message-ID: <4d1kl2$64c@daphne.ecmwf.int>
- References: <4d0j6r$1ri@daphne.ecmwf.int> <ENNO.96Jan10223330@kitz.inferenzsysteme.informatik.th-darmstadt.de>
- NNTP-Posting-Host: munin.ecmwf.int
- X-Newsreader: TIN [version 1.2 PL2]
-
- [stuff deleted]
-
- : For the class
-
- : struct Foo { void bar(); }
-
- : a method-invocation like:
-
- : Foo f;
- : SharedObject<Foo> s(&f);
- : s->bar(); // (1)
-
- : results in
- :
- : ((s.operator->()).operator->())->bar(); // = (1)
-
- : IMHO, the 'LockObject' temporary created in this expression should be
- : destroyed after this line. To force this behavior from an unwilling
- : compiler (;-) one can put (1) in brackets. So the brackets are used to
- : restrict the lifetime of the temporary and not the one of the SharedObject
- : instance.
-
- : Enno
-
- Thanks for showing some nterest to my original posting. I was
- trying to establish a way to wrap/lock any object and them forget about
- it. So the { } are not a satisfactory. It looks like my compiler
- (cfront 3.??) is not right.
-
- Baudouin
- --
-
- ---------------------------------------------------
- Baudouin Raoult.
- European Center for Medium Range Weather Forecast
- Reading, UK
- ---------------------------------------------------
-